<%@ page import="cn.kongwg.pojo.Student" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/1/24
  Time: 16:29
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
 <%

     List<Student> list = new ArrayList<>();
     for (int i = 0; i < 10; i++) {
         Student student = new Student(i, "name" + i, "passwd" + i, 18 + i, "phone" + 1);
         list.add(student);

     }
     request.setAttribute("list",list);
 %>

<c:forEach  begin="2"  end="7" step="2" items="${requestScope.list}" var="stu">
   ${stu.id}
   ${stu.username}
   ${stu.password}
   ${stu.age}
   ${stu.phone}<br>
</c:forEach>
</body>
</html>
